package thread;

/**
 * Created by chengxiaoqi1 on 2019/3/5.
 */
public class Sync {

    public void test() {
        synchronized (this) {
            System.out.println("test 开始...");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("test 结束");
        }

    }

}
